package com.example.proyyj.Service;

import com.example.proyyj.Entity.Exhibit;
import com.example.proyyj.Impl.ExhibitImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service//服务层
public class ExhibitService implements ExhibitImpl {
    @Resource //依赖注入
    ExhibitImpl exhibit;

    /**
     * 添加展会
     * @param Name  展会名
     * @param Address 展会地点
     * @param Date 展会时间
     * @param Information 展会信息
     * @return JSON
     */
    @Override
    public int addExhibit(String Name, String Address, String Date, String Information) {
        return exhibit.addExhibit(Name,Address,Date,Information);
    }

    /**
     * 删除展会
     * @param id 展会id
     * @return int
     */
    @Override
    public int delExhibitById(int id) {
        return exhibit.delExhibitById(id);
    }

    /**
     * 修改展会
     * @param Name 展会名
     * @param Address 展会地点
     * @param Date 展会时间
     * @param Information 展会信息
     * @param id 需要更改的展会id
     * @return json
     */
    @Override
    public int upExhibit(String Name, String Address, String Date, String Information, int id) {
        return exhibit.upExhibit(Name,Address,Date,Information,id);
    }

    /**
     * 根据id查询展会
     * @param id 展会id
     * @return json
     */
    @Override
    public Exhibit getExhibitById(int id) {
        return exhibit.getExhibitById(id);
    }

    @Override
    public List<Exhibit> getExhibitList() {
        return exhibit.getExhibitList();
    }

    @Override
    public List<Exhibit> randomExhibit() {
        return exhibit.randomExhibit();
    }


}
